<<<<<<< HEAD
# -*- coding:utf-8 -*- 
# 2013-08-13

def get_week_range( curr = None , work = False ):
	"""
	取得某个一周中的日期
	Argc:
	curr =>  获取的日期, 不填为获取当前日期
	work =>  True: 只获取工作日， False: 获取全周
	Retun:
		{ weekday: day , .... }
	.eg:
		get_week_day(work = True)
	"""
	curr = datetime.datetime.now() if not curr else curr
	curr_week = curr.weekday()

	result = {}
	for i in xrange(curr_week, -1, -1):
		dt = (curr - datetime.timedelta(days=i))
		result[dt.weekday()+1] = datetime.datetime( dt.year, dt.month, dt.day )

	for i in xrange(curr_week ,7 - curr_week):
		dt = (curr + datetime.timedelta(days=i))
		result[dt.weekday()+1] = datetime.datetime( dt.year, dt.month, dt.day )

	if work:
		del result[6]
		del result[7]

=======
# -*- coding:utf-8 -*- 
# 
def get_week_range( curr = None , work = False ):
	"""
	取得某个一周中的日期
	Argc:
	curr =>  获取的日期. None: 获取当前日期
	work =>  True: 只获取工作日， False: 获取全周
	Retun:
		{ weekday: day , .... }
	.eg:
		get_week_day(work = True)
	"""
	curr = datetime.datetime.now() if not curr else curr
	curr_week = curr.weekday()

	result = {}
	for i in xrange(curr_week, -1, -1):
		dt = (curr - datetime.timedelta(days=i))
		result[dt.weekday()+1] = datetime.datetime( dt.year, dt.month, dt.day )

	for i in xrange(curr_week ,7 - curr_week):
		dt = (curr + datetime.timedelta(days=i))
		result[dt.weekday()+1] = datetime.datetime( dt.year, dt.month, dt.day )

	if work:
		del result[6]
		del result[7]

>>>>>>> 0db5d7653c0f6bb033191666d7fd254b9326bb09
	return result